package com.atguigu.yygh.hosp.controller;

import com.atguigu.yygh.hosp.service.DepartmentService;
import com.atguigu.yygh.vo.hosp.DepartmentVo;
import com.atguigu.yygu.common.resulit.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@RestController
@RequestMapping("/admin/hosp/department")
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    //根据医院编号查询医院的所有科室
    @GetMapping("/getDeptList/{hospcode}")
    public Result getDeptList(@PathVariable String hospcode) {
        List<DepartmentVo> list = departmentService.findDeptTree(hospcode);
        return Result.ok(list);
    }

}
